<template>
	<view>
		<view class="search-box">
				<my-search ></my-search>
		</view>
	
		
		<view class="scroll-view-container">
			<scroll-view scroll-y="true" :style="{height:wh+'px'}" class="left-scroll-view">
				<block v-for="(item,i) in 15" :key="i">
					<view :class="['left-scroll-view-item',i === active?'active':'']" @click="touchItem(i)"> xxx{{i}} </view>
				</block>
				
	
			</scroll-view>

			<scroll-view scroll-y="true" :style="{height:wh+'px'}">
			<block v-for="(item,i) in 15" :key="i">
				<view class="right-scroll-view-item" @click="touch_goods(active,i)">x-{{active}}: y-{{i}} </view>
			</block>
			
			</scroll-view>
		</view>
	
	</view>
</template>

<script>
	import  badgeMix from "../../static/mixin/tabbar-badge.js"
	export default {
			mixins:[badgeMix],
		data() {
			return {
				wh: 0,
				active:0
			};
		},
		onShow() {
			this.setBadge()
		},
		onLoad() {
			const sysInfo = uni.getSystemInfoSync()
			
			this.wh = sysInfo.windowHeight-50
		
		},
	
		methods:{
			touchItem(i){
				// console.log(i);
				this.active = i
			},
			touch_goods(i){
				uni.navigateTo({
					url:`../list/list?item=${this.active}&index=${i}`,
					
				})
			}
	
		}
	
	}
</script>

<style lang="scss">
		
	.search-box{
		position: sticky;
		top: 0;
		z-index:999;
	}
	.scroll-view-container {
		display: flex;

		.left-scroll-view {
			width: 120px;
		}
		.left-scroll-view-item{
			background-color: #f7f7f7;
			line-height: 60px;
			text-align: center;
			font-size: 12px;
			
			&.active{
				background-color:#ffffff ;
				position: relative;
				&::before{
					content: ' ';
	 				display: block;
					width: 3px;
					height: 30px;
					background-color: #c00000;
					position: absolute;
					top: 25%;
				}
			}
		}
		.right-scroll-view-item{
			background-color: #f7f7f7;
			line-height: 60px;
			padding-left: 20px;
			// text-align: center;
			font-size: 12px;
		}
	}
</style>